package com.ellricky.baselib.adapter

import android.app.Activity
import android.widget.ImageView
import com.andr.common.ui.adapter.BaseRecyclerAdapter
import com.andr.common.ui.adapter.SmartViewHolder
import com.ellricky.baselib.R
import com.ellricky.baselib.entity.new.LifePhoto
import com.ellricky.baselib.util.GlideUtil
import kotlinx.android.synthetic.main.base_adapter_photo.view.*

class PhotoAdapter(val ctx: Activity) :
    BaseRecyclerAdapter<LifePhoto>(R.layout.base_adapter_photo) {

    override fun onBindViewHolder(vh: SmartViewHolder, data: LifePhoto, p2: Int) {
        val ivPhoto = vh.itemView.findViewById<ImageView>(R.id.iv_photo)
        GlideUtil.into(ctx, data.img_adr, ivPhoto)

        vh.text(R.id.tv_upload_time, data.img_createtime)
    }
}